<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<style>
#templatemo_menu {
	height: auto !important;
}

a#shopping-cart {
	background: #EFF1F4;
	border-radius: 5px;
	font-size: 13px;
	font-weight: bold !important;
	color: #6E6E6E;
	width: inherit;
}

.item_add {
	/* float: right !important; */
	
}

.item_price {
	right: -115px;
	position: relative;
}

.item_product-id {
	right: -95px;
	position: relative;
}
</style>

<script type="text/javascript">
	ddsmoothmenu.init({
		mainmenuid : "templatemo_menu",
		orientation : 'h',
		classname : 'ddsmoothmenu',
		contentsource : "markup"
	})

	function clearText(field) {
		if (field.defaultValue == field.value)
			field.value = '';
		else if (field.value == '')
			field.value = field.defaultValue;
	}
	simpleCart({
		cartColumns : [
				{
					attr : "product-id",
					label : "Mã SP"
				},
				{
					attr : "name",
					label : "Tên sản phẩm"
				},
				{
					view : "currency",
					attr : "price",
					label : "Giá"
				},

				{
					attr : "quantity",
					label : "Số lượng"
				},
				{
					view : function(item, column) {
						return "<div>"
								+ "<a href='javascript:;' class='simpleCart_increment'><span class='glyphicon glyphicon-chevron-up' style='display:block;'></span></a>"
								+ "<a href='javascript:;' class='simpleCart_decrement'><span class='glyphicon glyphicon-chevron-down' style='display:block;'></span></a>"
								+ "</div>";
					},
					attr : 'custom'
				}, {
					view : "currency",
					attr : "total",
					label : "Thành tiền"
				}, {
					view : "remove",
					text : "Remove",
					label : false
				} ],
		cartStyle : "table",
		checkout : {
			type : "SendForm",
			url : "http://localhost:8080/CIMS/purchase.action",
			method : "POST",
		}
	});

	simpleCart.bind('beforeCheckout', function(data) {
		data.userId = $("#sess_userid").val();
	});

	function checkOut() {
		if ($("#sess_authed").val() == 'true') {
			simpleCart.checkout();
		} else {
			alert("Bạn cần đăng nhập trước khi thanh toán!");
			$("#pre_login_required").submit();
		}
	};

	function showCartOpt() {
		$("ul.shopping-cart-opts").css("visibility", "visible");
		$("ul.shopping-cart-opts").toggle("fast");
	};
</script>
<div id="templatemo_footer_wrapper">
	<div id="templatemo_footer">
		<div class="footer_left"></div>
		<div class="footer_right">
			<p>
				<a href="/CIMS/web/index.jsp">Trang Chủ</a> | <a
					href="/CIMS/web/products.jsp">Dịch Vụ</a> | <a
					href="/CIMS/web/about.html">Giới Thiệu</a> | <a
					href="/CIMS/web/faqs.jsp">Câu hỏi thường gặp</a> |
				<!-- <a href="/CIMS/web/checkout.jsp">Thanh toán</a> | -->
				<a href="/CIMS/web/contact.jsp">Liên Hệ</a>
			</p>
			<p>
				Bản Quyền © 2014 <a href="#">God's Team</a> | Thiết Kế: <a
					href="/CIMS/web/index.jsp">CIMS</a>
			</p>
		</div>
		<div class="cleaner"></div>
	</div>
</div>
